//
//  TSUserModel.h
//  chart
//
//  Created by xu on 15/7/26.
//  Copyright (c) 2015年 xu. All rights reserved.
//

#import "QSFetchModel.h"

@protocol TSUserModel <NSObject>

@end

@interface TSUserModel : QSFetchModel

@property (nonatomic, strong) NSString *userId;
@property (nonatomic, strong) NSString *workId;
@property (nonatomic, strong) NSString *userName;
@property (nonatomic, strong) NSString *passWord;
@property (nonatomic, strong) NSString *lastType;
@property (nonatomic, strong) NSString *phone;
@property (nonatomic, strong) NSString *level;
@property (nonatomic, strong) NSString *section;
@property (nonatomic, strong) NSString *sectionName;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *timeLast;
@property (nonatomic, strong) NSString *parent;

+ (instancetype)sharedInstance;

- (void)loginWithUser:(NSString *)userName
          andPassword:(NSString *)pwd
    completionHandler:(void(^)(BOOL isSucceeded, NSError *error))handler;

- (void)logout:(void(^)(BOOL isSucceeded, NSError *error))handler;

- (void)modify:(NSString *)name
     andWorkId:(NSString *)workId andPhone:(NSString *)phone
completionHandler:(void(^)(BOOL isSucceeded, NSError *error))handler;

- (void)modifyPwd:(NSString *)oldPwd andNewPwd:(NSString *)newPwd completionHandler:(void(^)(BOOL isSucceeded, NSError *error))handler;

- (void)registerWithUser:(NSString *)userName
             andPassword:(NSString *)pwd andPhone:(NSString *)phone
    completionHandler:(void(^)(BOOL isSucceeded, NSError *error))handler;

@end
